const Koa = require('koa')
const app = new Koa()
const router = require('./router/api')
const cors = require('koa2-cors')
const bodyParser = require('koa-bodyparser')



app.use(cors()) //解决跨域
app.use(bodyParser())  //解决接不到post的值

app.use(router.routes())
   .use(router.allowedMethods());

console.log('ready')
app.listen(8080);